﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.UI.WebControls;

namespace FilesArranger
{
	public interface ITreeToDo
	{

		DivNode[] LoadChildren(string sourcePath);

		void DeleteChildNode(string sourcePath, DivNode node, ToDoCallBack toDoCallback);

		void CreateFolderNode(string sourcePath, DivNode node, ToDoCallBack toDoCallback);

		void CreateFileNode(string sourcePath, DivNode node, ToDoCallBack toDoCallback);

		void MoveFolderNode(string sourcePath, string destinationPath, ToDoCallBack toDoCallback);

		void MoveFileNode(string sourcePath, string destinationPath, ToDoCallBack toDoCallback);

		DivNode[] Refresh(IDictionary<string, object> pathsExpandRecord);
	}

	public delegate void ToDoCallBack(bool result, string message);

	public class DivNode
	{
		private string _Text;

		public string Text
		{
			get { return _Text; }
			set { _Text = value; }
		}

		private string _Value;

		public string Value
		{
			get { return _Value; }
			set { _Value = value; }
		}

		private string _NavigateHref;

		public string NavigateHref
		{
			get { return _NavigateHref; }
			set { _NavigateHref = value; }
		}

		private string _NavigateTarget;

		public string NavigateTarget
		{
			get { return _NavigateTarget; }
			set { _NavigateTarget = value; }
		}

		private string _TypeIcon;

		public string TypeIcon
		{
			get { return _TypeIcon; }
			set { _TypeIcon = value; }
		}

		private string _ToolTip;

		public string ToolTip
		{
			get { return _ToolTip; }
			set { _ToolTip = value; }
		}

		private string _ImageToolTip;

		public string ImageToolTip
		{
			get { return _ImageToolTip; }
			set { _ImageToolTip = value; }
		}

		private ExpandCollapseIconEnum _ExpandCollapseStatus;

		public ExpandCollapseIconEnum ExpandCollapseStatus
		{
			get { return _ExpandCollapseStatus; }
			set { _ExpandCollapseStatus = value; }
		}

		private bool _ShowCheckBox;

		public bool ShowCheckBox
		{
			get { return _ShowCheckBox; }
			set { _ShowCheckBox = value; }
		}

		private bool _ShowTypeIcon;

		public bool ShowTypeIcon
		{
			get { return _ShowTypeIcon; }
			set { _ShowTypeIcon = value; }
		}

		private DivNode[] _ChildNodes;

		public DivNode[] ChildNodes
		{
			get { return _ChildNodes; }
			set { _ChildNodes = value; }
		}

		private bool _Selected;

		public bool Selected
		{
			get { return _Selected; }
			set { _Selected = value; }
		}


	}

	public enum ExpandCollapseIconEnum
	{

		None = 0,

		PopulateExpand = 1,

		Collapse = 2,

		Expand = 3,
	}

}
